const host = 'https://missfresh.insideria.vip'
export default {
	get(url,data){
		return new Promise((resove,reject)=>{
			console.log(": ",);
			uni.request({ method:'GET', url:host + url, data:data,
				header: {
				    'Content-Type': 'application/json', 
					'authori-zation':uni.getStorageSync('token')
				},
				success: (res) => {resove(res.data)},
				fail(e) {reject(e)}
			})
		}) 
	},
	post(url,data){
		return new Promise((resove,reject)=>{
			uni.request({ method:'POST', url:host + url, data:data,
				header: {
				    'Content-Type': 'application/json', 
					'authori-zation':uni.getStorageSync('token')
				},
				success: (res) => {resove(res)},
				fail(e) {reject(e)}
			})
		}) 
	},
	postFrom(url,data){
		return new Promise((resove,reject)=>{
			uni.request({ method:'POST', url:host + url, data:data,
				header: {
				    'Content-Type': 'application/x-www-form-urlencoded', 
					'token':uni.getStorageSync('token')
				},
				success: (res) => {resove(res)},
				fail(e) {reject(e)}
			})
		}) 
	},
}